80201: Function test xfi:s-equal

Documentation

Tests of function xfi:s-equal($left as node()*, $right as node()*) as xs:boolean

Owners

Name Affiliation Email Start End
Herm Fischer UBMatrix / Mark V Systems fischer@markv.com 19-02-2008 at 00:00:00

References

http://www.xbrl.org/Specification/XF-PWD-2006-12-07.htm#_Toc152670703

Test Case Variations


V-01 Returns s-equality of nodes equal and in order

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq true()

V-02 Same as V-01 but typed dimension elements in different order

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-03 Same as V-01 but arguments are sequences

Documentation

Inputs

  • schema: s-equal2.xsd
  • linkbase: s-equal2-definition.xml
  • instance: s-equal2-instance.xml (DTS Discovery starting point) (ID=V03)
  • Function Call: xfi:s-equal( ( //xbrli:context[@id='c-V01-left'], //concept:P3[@id eq 'V02-left']), ( //xbrli:context[@id='c-V01-right'], //concept:P3[@id eq 'V02-left']) )

    (against file V03)

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq true()

V-04 Same as V-01 but arguments are sequences not same length

Documentation

Inputs

  • schema: s-equal2.xsd
  • linkbase: s-equal2-definition.xml
  • instance: s-equal2-instance.xml (DTS Discovery starting point) (ID=V04)
  • Function Call: xfi:s-equal( ( //xbrli:context[@id='c-V01-left'], //concept:P3[@id eq 'V02-left']), ( //xbrli:context[@id='c-V03-right'] ) )

    (against file V04)

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-05 Example 25 contexts equal because entity and period are s-equal

Documentation

Inputs

  • schema: example25.xsd
  • instance: example25-instance.xml (DTS Discovery starting point) (ID=V05)
  • Function Call: xfi:s-equal( //xbrli:context[@id eq 'np3'], //xbrli:context[@id eq 'Xnnp3X'] )

    (against file V05)

Outputs

  • Result test: $result eq true()

V-06 Example 25 f name and g name have different context ids np3 and Xnnp3X which are nevertheless s-equal

Documentation

Inputs

  • schema: example25.xsd
  • instance: example25-instance.xml (DTS Discovery starting point) (ID=V06)
  • Function Call: xfi:s-equal( //s:name[@id eq 'fName'], //s:name[@id eq 'gName'] )

    (against file V06)

Outputs

  • Result test: $result eq true()

V-07 Example 25 b name and c name have different context ids np3 and Xnnp3X which are nevertheless s-equal

Documentation

Inputs

  • schema: example25.xsd
  • instance: example25-instance.xml (DTS Discovery starting point) (ID=V07)
  • Function Call: xfi:s-equal( //s:name[@id eq 'bName'], //s:name[@id eq 'cName'] )

    (against file V07)

Outputs

  • Result test: $result eq true()

V-08 Example 25 b gross and c gross not s-equal

Documentation

Inputs

  • schema: example25.xsd
  • instance: example25-instance.xml (DTS Discovery starting point) (ID=V08)
  • Function Call: xfi:s-equal( //s:gross[@id eq 'bGross'], //s:gross[@id eq 'cGross'] )

    (against file V08)

Outputs

  • Result test: $result eq false()

V-09 Example 25 b customer and c customer have different context ids np3 and Xnnp3X

Documentation

Inputs

  • schema: example25.xsd
  • instance: example25-instance.xml (DTS Discovery starting point) (ID=V09)
  • Function Call: xfi:s-equal( //s:customer[@id eq 'bCustomer'], //s:customer[@id eq 'cCustomer'] )

    (against file V09)

Outputs

  • Result test: $result eq false()

V-10 Example 25 b returns and d returns have different values

Documentation

Inputs

  • schema: example25.xsd
  • instance: example25-instance.xml (DTS Discovery starting point) (ID=V10)
  • Function Call: xfi:s-equal( //s:returns[@id eq 'bReturns'], //s:returns[@id eq 'dReturns'] )

    (against file V10)

Outputs

  • Result test: $result eq false()

V-11 Example 25 b customer and d customer have different values of returns and net

Documentation

Inputs

  • schema: example25.xsd
  • instance: example25-instance.xml (DTS Discovery starting point) (ID=V11)
  • Function Call: xfi:s-equal( //s:customer[@id eq 'bCustomer'], //s:customer[@id eq 'dCustomer'] )

    (against file V11)

Outputs

  • Result test: $result eq false()

V-12 Wrong node to function

Documentation

XPath-defined error for node type incorrect.

Inputs

Outputs

  • Error code: xqt-err:XPTY0004

V-13 A sequence of concepts as argument

Documentation

XPath-defined error for node type incorrect number of arguments.

Inputs

Outputs

  • Error code: xqt-err:XPST0017

V-14 Would be expected to return s-equality of nodes equal and in order, but typed dimension contains an xbrli:dateUnion instant date.

Documentation

S-equality comparison of dateUnion with xs:date eq xs:dateTime will be performed using Base Spec 2.1 x-equality checking, which is done by comparing strings. In this case the date of 2007-02-28 and dateTime of 2007-03-01T00:00:00 will be compared lexically (as strings, not as typed XPath 2 objects), so the result is false. See Example 0004 (restatement date) for specific user-level XPath 2 coding to handle a typed dimension with a dateUnion known to report an instant date. XPath-defined error for type mismatch detection.

Inputs

Outputs

  • Result test: $result eq false()

V-15 Same as V-01 but nested IDs differ, to be sure this is detected as s-inequality (bug 378)

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

Revisions

Name On Details
Herm Fischer 19-02-2008 at 00:00:00 Created the test case.
Herm Fischer 31-01-2010 at 10:30:00 Updated V-01 - V-04 to remove nested ids, per bug 378, to ensure tests check the intent of test; variation v-15 added for nested id detection as s-inequality.
Herm Fischer 11-09-2010 at 00:00:00 Corrected test case instances removing nested IDs in context typed dimension values per bug 378.
Herm Fischer 16-10-2010 at 00:00:00 Per IHR, corrected V14 to have a false() result, when comparing date unions where one is a date and the other a dateTime, because they are compared lexically as strings, not as typed objects.